#region Copyright Jonathan Quiros

//	
// All rights are reserved. Reproduction or transmission in whole or in 
// part, in any form or by any means, electronic, mechanical or otherwise, 
// is prohibited without the prior written consent of the copyright owner.
//
// Filename: SubmitResults.cs
//

#endregion

using System.Collections;
using System.Collections.Generic;
using System.Web;
using Ids.Web.Listing;

namespace Novagoal.Website.Models
{
    public class SubmitResults : ModelErrors
    {
        #region CONSTANTS

        private const string SUCCESS_MESSAGE_KEY = "SuccessMessage";

        #endregion

        #region PROPERTIES

        private readonly IDictionary _items = new Dictionary<string, object>();

        #endregion

        #region PUBLIC METHODS

        /// <summary>
        /// Gets or sets a value indicating whether [submit success].
        /// </summary>
        /// <value><c>true</c> if [submit success]; otherwise, <c>false</c>.</value>
        public bool SuccessSubmit
        {
            get
            {
                return !string.IsNullOrEmpty(SuccessMessage);
            }
        }

        /// <summary>
        /// Gets or sets the success message.
        /// </summary>
        /// <value>The success message.</value>
        public string SuccessMessage
        {
            get
            {
                return Items[SUCCESS_MESSAGE_KEY] as string;
            }
            set
            {
                Items[SUCCESS_MESSAGE_KEY] = value;
            }
        }

        #endregion

        #region PRIVATE METHODS

        private IDictionary Items
        {
            get { return HttpContext.Current != null ? HttpContext.Current.Items : _items; }
        }

        #endregion
    }
}